package rpg.core
{
	import flash.display.BitmapData;

	import rpg.Utils.GameUtils;
	import rpg.Utils.Val;
	import rpg.manager.GameManager;
	import rpg.render.RenderData;
	import rpg.role.SceneObject;

	public class ShadowComponent extends RenderComponent
	{
		private var shadowBmd : BitmapData;

		public function ShadowComponent(type : *)
		{
			super(type);
		}

		override public function notifyAdded() : void
		{
			super.notifyAdded();
			shadowBmd = GameManager.getInstance().smallShadow;
			render.bitmapData = shadowBmd;
			render.zIndex = Val.BOTTOM;
			offsetX = shadowBmd.width * .5;
			offsetY = shadowBmd.height * .5 + 70;
		}

		override public function updateRender(sceneX : int , sceneY : int , offsetX : int = 0 , offsetY : int = 0) : void
		{
			render.x = sceneX - offsetX;
			render.y = sceneY - offsetY;
		}
	}
}